package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.SLotteryDao;
import com.xyz.domain.table.SLottery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SLotteryLogic {

    @Autowired
    private SLotteryDao sLotteryDao;

    public SLottery add(SLottery sLottery){
        return sLotteryDao.insert(sLottery);
    }

    public Integer update(SLottery sLottery){
        return sLotteryDao.update(sLottery);
    }

    public List<SLottery> list(SLottery sLottery, String orderBy){
        return sLotteryDao.selectList(sLottery, orderBy);
    }

    public Integer delete(Integer key){
        return sLotteryDao.delete(key);
    }

    public PageResponseModel<SLottery> pageInfo(SLottery sLottery, String orderBy, Integer pageNo, Integer pageSize){
        return sLotteryDao.selectByPageNo(sLottery, orderBy, pageNo, pageSize);
    }

    public List<SLottery> getAllLotteryInfos(){
        return sLotteryDao.getAllLotteryInfos();
    }



}